Skip to content

create pubsub topic on startup if it doesn't exists #291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

agbpatro
Copy link
Collaborator

@agbpatro agbpatro commented Jan 6, 2025

Description

  • to prevent hitting resource quota, create the google pubsub topic on startup and reuse it for future data transmissions

Fixes # (#289)

Type of change

Please select all options that apply to this change:

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Bug fix (non-breaking change which fixes an issue)
  • Documentation update

Checklist:

Confirm you have completed the following steps:

  • My code follows the style of this project.
  • I have performed a self-review of my code.
  • I have made corresponding updates to the documentation.
  • I have added/updated unit tests to cover my changes.
  • I have added/updated integration tests to cover my changes.

@agbpatro agbpatro force-pushed the create_topic_if_doesnt_exist_startup branch from 69e5e04 to a3a0934 Compare January 6, 2025 18:55
@agbpatro agbpatro force-pushed the create_topic_if_doesnt_exist_startup branch 2 times, most recently from 5246522 to 39c902f Compare January 6, 2025 19:15
README.md Outdated
@@ -156,6 +156,7 @@ Dispatchers handle vehicle data processing upon its arrival at Fleet Telemetry s
* Configure stream names directly by setting the streams config `"kinesis": { "streams": { *topic_name*: stream_name } }`
* Override stream names with env variables: KINESIS_STREAM_\*uppercase topic\* ex.: `KINESIS_STREAM_V`
* Google pubsub: Along with the required pubsub config (See ./test/integration/config.json for example), be sure to set the environment variable `GOOGLE_APPLICATION_CREDENTIALS`
* Fleet Telemetry server will try to create topics on startup. If it topic doesn't exists or creation of topic fails, server will fail to startup and crash.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shorter option: On startup, the server will attempt to create missing topics and panic on failure.

@agbpatro agbpatro force-pushed the create_topic_if_doesnt_exist_startup branch from 39c902f to 1ac90e7 Compare January 6, 2025 23:20
@agbpatro agbpatro merged commit e772a03 into main Jan 6, 2025
5 checks passed
@agbpatro agbpatro deleted the create_topic_if_doesnt_exist_startup branch January 6, 2025 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants